#ifndef WIDGET_SETUP_LOCAL_H
#define WIDGET_SETUP_LOCAL_H



#include "players.h"
#include "widget_setup.h"
#include "gui.h"



/** @brief Class representating line with added player info
*
*   \image html widget_setup_local.jpeg
*/
class added_player: public QWidget
{

public:

	/** @brief Constructor creates the line with information - id, name, type, color
	*	@param pl added player, constraint: pl != 0
	*	@param parent Qt parent
	*	@param flags Qt flags
	*/
	added_player( player* pl, QWidget* parent = 0, Qt::WindowFlags flags = 0 );

};



/** @brief Gui class for loading maps and setting parameters for local game
*
*   \image html widget_setup_local.jpeg
*/
class local_setup_widget: public setup_widget
{

	Q_OBJECT

public:

	/** @brief Creates part of the gui
	*	@param parent Qt parent
	*	@param flags Qt flags
	*/
	local_setup_widget( QWidget* parent = 0, Qt::WindowFlags flags = 0 );

	/** @brief Shows connection status message (not implemented here)
	*	@param s status message
	*/
	void show_status( const string& s )
	{};
	

private:

	//! widget layout
	QVBoxLayout* layout;
	//! input field for player's name
	QLineEdit* name_i;
	//! input field for player's type
	QComboBox* type_i;
	//! input field for player's algorithm
	QComboBox* algorithm_i;
	//! add new player button
	QPushButton* add_b;
	//! set player's algorithm button
	QPushButton* algorithm_b;
	//! input field for map filename
	QLineEdit* load_i;
	//! input field for object file filename
	QLineEdit* object_i;
	//! load map filename button
	QPushButton* load_filename_b;
	//! load saved objects filename button
	QPushButton* object_filename_b;
	//! load map button
	QPushButton* load_b;
	//! load saved objects button - can be pressed when map is loaded
	QPushButton* object_b;
	//! next button - can be pressed when map is loaded
	QPushButton* next_b;
	

private slots:

	//! @brief Qt slot that jumps to buy screen
	void next();
	//! @brief Qt slot that adds new player
	void add_player();
	//! @brief Qt slot that sets player's algorithm
	void set_algorithm();
	//! @brief Qt slot that loads map filename
	void load_filename_map();
	//! @brief Qt slot that loads saved objects filename
	void load_filename_objects();
	//! @brief Qt slot that loads map
	void load_map();
	//! @brief Qt slot that loads saved objects
	void load_objects();

};



#endif